package com.aiyige.page.globalsearch.adapter;

import android.text.Html;
import android.view.View;
import android.widget.TextView;

import com.aiyige.R;
import com.aiyige.page.globalsearch.model.KeywordAssociateItem;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.LinkedList;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by zhuyakun on 2017/12/8.
 */

public class KeywordAssociateAdapter extends BaseQuickAdapter<KeywordAssociateItem, KeywordAssociateAdapter.ViewHolder> {

    public KeywordAssociateAdapter() {
        super(R.layout.keyword_associate_item, new LinkedList<KeywordAssociateItem>());
    }

    @Override
    protected void convert(ViewHolder helper, KeywordAssociateItem item) {
        helper.bindData(item);
    }


    public class ViewHolder extends BaseViewHolder {
        @BindView(R.id.itemTv)
        TextView itemTv;

        public ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }

        public void bindData(KeywordAssociateItem data) {
            itemTv.setText(Html.fromHtml(data.getKeyword()));
        }
    }

}
